package com.io.example.demoparent.listener;

import com.io.example.demoparent.bo.BizEvent;
import com.io.example.demoparent.service.BizEventListener;

/**
 * @program: demo-project
 * @ClassName EventSubscriber
 * @description:
 * @author: 宠儿
 * @create: 2024−09-05 23:32
 * @Version 1.0
 **/
public class EventSubscriber  implements  Runnable {

    /**
     * 业务监听器
     **/
    private BizEventListener bizEventListener;

    /**
     * 业务事件
     */
    private BizEvent bizEvent;

    public EventSubscriber(BizEventListener bizEventListener, BizEvent bizEvent) {
        this.bizEventListener = bizEventListener;
        this.bizEvent = bizEvent;
    }

    public BizEventListener getBizEventListener() {
        return bizEventListener;
    }

    public void setBizEventListener(BizEventListener bizEventListener) {
        this.bizEventListener = bizEventListener;
    }

    public BizEvent getBizEvent() {
        return bizEvent;
    }

    public void setBizEvent(BizEvent bizEvent) {
        this.bizEvent = bizEvent;
    }


    @Override
    public void run() {
        bizEventListener.onEvent(bizEvent);
    }
}
